package sg.edu.nus.iss.club.gui;
import java.awt.GridLayout;
import java.awt.event.*;


import javax.swing.*;

public class ClubWindow extends JFrame{
	ClubApplication parent;
	
	MemberPanel memberPanel;
	
	ClubWindow(ClubApplication parent) {
		super ("Club Management System");
		this.parent = parent;
		JPanel p = new JPanel();
		p.setLayout (new GridLayout(0, 1));
		memberPanel = new MemberPanel(parent);
		
		p.add("Center", memberPanel);
		add(p);
		addWindowListener(listerner);
		//refresh();
		
	}
	

	private WindowListener listerner = new WindowAdapter() {
		public void windowClosing (WindowEvent e) {
			System.out.println("Closing the Window");
			parent.shutdown();
	
		}
	};
	
	public MemberPanel getMemberPanel(){
		return memberPanel;
	}
	
	
	public void refresh () {
		memberPanel.refresh();
		
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
